 <template>
  <el-form ref="refFrom" label-position="top" class="padding">
    <el-row>
      <el-col :span="6">
        <el-form-item label="活动类型">
          {{marchType(currentItem.activityType,type)}}
        </el-form-item>
      </el-col>
    </el-row>
  </el-form>
</template>

<script lang="ts">
export default {
  props: {
    data: {}
  },
  data() {
    return {
      currentItem: {},
      settleType: [
        { label: '自动', value: '1' },
        { label: '手动', value: '2' }
      ],
      status: [
        { label: '结算中', value: '1' },
        { label: '已结算', value: '2' },
        { label: '已转款', value: '3' },
        { label: '已完结', value: '4' },
        { label: '已作废', value: '5' }
      ],
      settleContents: [
        { label: '用氧', value: '1' },
        { label: '充灌', value: '2' },
        { label: '电费', value: '3' }
      ]
    };
  },
  created() {
    this.init();
  },
  methods: {
    init(data) {
      if (data == null) data = this.data;
      this.currentItem = JSON.parse(JSON.stringify(data));
      console.log(this.currentItem);
    },
    /**
     * 匹配结果
     */
    marchType(value, types) {
      if (types == null) return '-';
      for (let i = 0; i < types.length; i++) {
        let type = types[i];
        if (type.value == value) return type.label;
      }
    }
  }
};
</script>

<style scoped>
.padding {
  padding: 0px;
}
</style>
